
 
 
<!DOCTYPE html>
<html>
{include file="public/head"}
<body>

{include file="public/nav"}

{include file="community/nav"}
<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8" >
       <div class="fly-panel"> 
   <div class="fly-panel-title fly-filter"> 
    <a>最热动态</a> 
    <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;"></a> 
   </div> 
   <ul class="fly-list"> 
       {foreach $mosthot as $v} 
             <li> <a href="{:url('web/Account/Info','user_id='.$v['user_id'])}" class="fly-avatar"> <img src="/static/../upload/users/head/{$v.head}" alt="{$v.user_id}">
              </a> <h2>  <a href="{:url('web/Community/articles','tid='.$v.topic_id)}">{$v.title}</a> 
                  {if condition="$v.type<=0"}
                   <a href="#" class=""><span class="layui-badge layui-bg-blue">普通讨论</span></a>
                  {else/}
                  <a href="{:url('web/Problem/problem','pid='.$v.type)}" class=""><span class="layui-badge layui-bg-blue">Problem-{$v.type}</span></a>
                  {/if}
                  
              </h2> 
     <div class="fly-list-info"> 
      <a href="{:url('web/Account/info','user_id='.$v['user_id'])}" > <cite>作者:{$v.user_id}</cite> </a> 
      <span>写作时间:{:date('Y-m-d H:i:s',$v.in_time)}</span> 
      <span class="fly-list-nums"> <i class="iconfont icon-zan" title="支持数"></i> {$v.support} </span> 
     </div> 
     <div class="fly-list-badge"> 
     </div>
    </li>
       {/foreach}
    
   </ul> 
            </div> 
        
          <div class="fly-panel"> 
           <div class="fly-panel-title fly-filter"> 
    <a>最新动态</a> 
    <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a> 
   </div> 
           <ul class="fly-list" id="topiclist">
           </ul>        
        
              
  </div> 
    </div>
 {include file="public/side-bar"}
  </div>
</div>
 {include file="public/foot"}
</body>
<script>
 

layui.use('flow', function(){
  var flow = layui.flow;
   var $ = layui.jquery; 
  flow.load({
    elem: '#topiclist' //流加载容器
    ,isAuto:false
    ,done: function(page, next){ //执行下一页的回调
      
      //模拟数据插入
        {if condition="$pid==0"}
        $.get("{:url('web/Community/gettopiclist')}/"+page, function(res){
        next(res.html, page < res.pages);
        });
        {else /}
        $.get("/api/getproblemtopiclist/item-{$pid}-"+page, function(res){
        next(res.html, page < res.pages);
        });
        {/if}
        
    }
  });
  
  
});
  
</script>
</html>